import request from "../../utils/request";

export const getAllUser = (data) => {
    return request.get("/admin/getAllUser", {
        params: {
            page: data.currentPage,
            pageSize: data.pageSize
        }
    })
}
export const addUser = (data) => {
    return request({
        url: '/admin/addUser',
        method: 'post',
        data: data
    })
}
export const updateUser = (data) => {
    return request.post("/admin/updateUser", data)
}
export const deleteUser = (data) => {
    return request.post("/admin/deleteUser", data)
}
//导入用户
export const uploadUser = (data) => {
    return request.post("/admin/uploadUser", data, {
        headers: {
            'Content-Type': 'multipart/form-data',
        },
    }
    )
}
export const getAllStudent = (data) => {
    return request({
        url: '/admin/getAllStudent',
        method: 'get',
        params: {
            page: data.currentPage,
            pageSize: data.pageSize
        }
    })
}
export const updateStudent = (data) => {
    return request({
        url: '/admin/updateStudent',
        method: 'post',
        data: data
    })
}
export const addStudent = (data) => {
    return request({
        url: '/admin/addStudent',
        method: 'post',
        data: data
    })
}
export const deleteStudent = (data) => {
    return request.post("/admin/deleteStudent", data)
}
export const getAllTeacher = (data) => {
    return request({
        url: '/admin/getAllTeacher',
        method: 'get',
        params: {
            page: data.currentPage,
            pageSize: data.pageSize
        }
    })
}
export const updateTeacher = (data) => {
    return request({
        url: '/admin/updateTeacher',
        method: 'post',
        data: data
    })
}
export const addTeacher = (data) => {
    return request({
        url: '/admin/addTeacher',
        method: 'post',
        data: data
    })
}
export const deleteTeacher = (data) => {
    return request.post("/admin/deleteTeacher", data)
}
export const getAllEmployer = (data) => {
    return request({
        url: '/admin/getAllEmployer',
        method: 'get',
        params: {
            page: data.currentPage,
            pageSize: data.pageSize
        }
    })
}
export const updateEmployer = (data) => {
    return request({
        url: '/admin/updateEmployer',
        method: 'post',
        data: data
    })
}
export const addEmployer = (data) => {
    return request({
        url: '/admin/addEmployer',
        method: 'post',
        data: data
    })
}
export const deleteEmployer = (data) => {
    return request.post("/admin/deleteEmployer", data)
}